import React from 'react'
// ===================================================================== Temp
import FormModal from '#cpt/temp/FormModal'
// ===================================================================== Declare
const { $fn, $Lazy } = window
// ===================================================================== Lazy
const $cache = $Lazy.file(()=>import('#private/cache-api'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		rows:{},
		// 提交表单列表
		formData : [
			{ label: '标本类型',		name: 'spec_type', 	full:true, 	required:true, type: 'select' },
		]
	}
	
	submit = {}
	
	open = param => {
		this.submit = param
		this.modal.open({ formRef: this.formRef })
		this.getModalSelect()
	}
	// 获取弹框下拉
	getModalSelect = async () => {
		const { formData } = this.state
		$fn.setModalRows(formData, 'spec_type', ()=>{
			$cache.then( async f => {
				$fn.setRow( formData, 'spec_type', await f.getDisCache({ code: 2000 }) )
				this.setState({ formData })
			})
		})
	}
	
	render(){
		return FormModal.call(this,{ title:'批量修改标本类型', labelWidth:'s5', width:600, api:'result-unit-item/updateSpecTypeBatch'})
	}
}

export default Index